// 引入公共样式
import './assets/main.scss'
import '@/styles/common.scss'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-persistedstate-plugin'
import ElementPlus from 'element-plus'
import locale from 'element-plus/dist/locale/zh-cn.js'

import App from './App.vue'
import router from './router'
// 1. el图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 测试axios拦截器
// import { getCategory } from './api/testAPI'

const app = createApp(App)
const pinia = createPinia()
const persistedState = createPersistedState()

pinia.use(persistedState)
app.use(pinia)
app.use(router)
app.use(ElementPlus, {locale})

// 2、el图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 测试axios拦截器
// getCategory().then(res => {
//   console.log(res)
// })

app.mount('#app')
